<template>
  <div name="AppListPage">
    <div class="s-Datastyle">
      <div class="left-content">
        <div class="menubox">
          <el-row class="tac">
            <el-col :span="24">
              <el-menu :defaultActive="activeIndex" :unique-opened="true" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose">
                <el-submenu index="1">
                  <template slot="title">
                    <span>政务服务</span>
                  </template>
                  <el-menu-item index="1-1">
                    <el-radio-group v-model="parms.radioGovernment" @change="GovernmentChange">
                      <el-radio :label="d.id" v-for="d in radioGovernmentList" :key="d.id">{{ d.name }}</el-radio>
                      <!--  -->
                    </el-radio-group>
                  </el-menu-item>
                </el-submenu>
              </el-menu>
            </el-col>
          </el-row>
        </div>
      </div>
      <div class="right-content">
        <div class="rightTitle">
          <p>
            共有
            <span>6</span>
            个资源
          </p>
        </div>
        <div>
          <AppListPage :data="AppDetailsList" />
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import AppListPage from "./AppRightList";
export default {
  name: "Interaction",
  components: {
    AppListPage,
  },
  data() {
    return {
      activeIndex: "1-1",
      radioGovernmentList: [],
      parms: {
        radioGovernment: "",
      },
      AppDetailsList: [],
    };
  },
  created() {
    this.getRadioGovernmentList();
    this.getDate();
  },
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
    GovernmentChange(d) {
      this.parms.radioGovernment = d;
      this.getDate();
    },
    getRadioGovernmentList() {
      this.$http
        .get("/iaiqsmde9fea569965ed56ab98ea0501752fe631902841e/open/app/getApp")
        .then(res => {
          if (res.code == 0) {
            this.radioGovernmentList = res.data.gov;
          }
        })
        .catch(err => {
          console.log(err.message || "数据异常");
        });
    },
    getDate() {
      this.$http
        .get("/iaiqsmde9fea569965ed56ab98ea0501752fe631902841e/open/app/appPager",{a:1,b:2})
        .then(res => {
          if (res.code == 0) {
            this.AppDetailsList = res.data.rows;
          }
        })
        .catch(err => {
          console.log(err.message || "数据异常");
        });
    },
  },
};
</script>
